
#ifndef CHESS_BOARD_POSITION_H
#define CHESS_BOARD_POSITION_H

#include <string>
#include <set>

/**
 * The BoardPosition class 
 */
class BoardPosition {

   public: //methods
      //! Constructor
      //! @param r the row
      //! @param c the column
      BoardPosition (int r=-1, int c=-1) {
         row = r;
         col = c;
      }

      BoardPosition & operator =(const BoardPosition & pos) {
         row = pos.row;
         col = pos.col;
         return *this;
      }

      // Based upon row first, then col if they match
      bool operator <(const BoardPosition & pos) const {
         return row == pos.row ? col < pos.col : row < pos.row;
      }

      bool operator >(const BoardPosition & pos) const {
         return row == pos.row ? col > pos.col : row > pos.row;
      }

      bool operator ==(const BoardPosition & pos) const {
         return row==pos.row ? col==pos.col : false;
      }

      //! returns a number the row, can be overridden
      int GetRow() const {
         return row;
      }

      //! returns a number the row, can be overridden
      int GetCol() const {
         return col;
      }

      bool IsOnBoard() {
         return row>-1 && row < 8 && col>-1 && col<8;
      }

      //! These methods simply check to see if the respective position is "on the board"
      //! @return true if on board, false if "off board"
      bool MoveUp();
      bool MoveRight();
      bool MoveDown();
      bool MoveLeft();
      bool MoveUpLeft();
      bool MoveUpRight();
      bool MoveDownLeft();
      bool MoveDownRight();

      
      void Reset() {
         row = -1;
         col = -1;
      }

   private:
      int row; //! the row this position represents
      int col; //! the column this position represents
};

#endif
